package com.bw.liuyushan.liuyushan20210904.GreenDao;

import android.database.sqlite.SQLiteDatabase;

import com.bw.liuyushan.liuyushan20210904.Managers.App;

/**
 * Liuyushan20210904
 * file name is : VideoDateUtils
 * created by Ender on 2021/9/4 11:42.
 * author : 刘雨杉
 * Describe:
 */
public class VideoDateUtils {
    DaoSession daoSession;
    private static VideoDateUtils videoDateUtils;

    public static VideoDateUtils getInstance() {
        if (videoDateUtils==null){
            synchronized (VideoDateUtils.class){
                if (videoDateUtils==null){
                    videoDateUtils=new VideoDateUtils();
                }
            }
        }
        return videoDateUtils;
    }

    private VideoDateUtils() {
        DaoMaster.DevOpenHelper devOpenHelper = new DaoMaster.DevOpenHelper(App.context, "VideoPath.db");
        SQLiteDatabase writableDatabase = devOpenHelper.getWritableDatabase();
        DaoMaster daoMaster = new DaoMaster(writableDatabase);

        daoSession = daoMaster.newSession();
    }

    public DaoSession getDaoSession() {
        return daoSession;
    }
}
